/**
 * Copyright By Nanjing Fujitsu Nanda Software Technology Co., Ltd
 * 下午5:34:07
 * Base64Utils.java
 * 
 */
package com.fujitsu.nanjing.mobile.common;
import java.io.IOException;

import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;

/**
 * @author qixb.fnst
 *
 */
public class Base64Utils {
    private static BASE64Encoder encoder=null;
    private static BASE64Decoder decorder=null;
    private static Base64Utils instance=new Base64Utils();
    static{
        encoder=new BASE64Encoder();
        decorder=new BASE64Decoder();
    }
    private Base64Utils(){
        
    }
    
    public static Base64Utils getInstance(){
        return instance;
    }
    public  String getString(byte[] bytes){
      return  encoder.encode(bytes);
    }
    public byte[] getBytes(String string) throws IOException{
        return decorder.decodeBuffer(string);
    }
    
}
